gl renderer: Fix scale computation
authorTimm Bäder <mail@baedert.org>
Sun, 2 Jun 2019 08:25:39 +0000 (10:25 +0200)
committerTimm Bäder <mail@baedert.org>
Sun, 2 Jun 2019 08:25:39 +0000 (10:25 +0200)
We don't need to just look at the scale of the new modelview matrix, but
at the one we get when multiplying the new one with the current one.

Test case attached.

gsk/gl/gskglrenderops.c
testsuite/gsk/compare/scale-up-down.node [new file with mode: 0644]
testsuite/gsk/compare/scale-up-down.png [new file with mode: 0644]
testsuite/gsk/meson.build

index 52529e4f6006cd8702ae2c4c5ed13cee2d541f88..9c99fba9150b70d5d23350d091029949e5db26e8 100644 (file)
@@ -450,7 +450,7 @@ ops_push_modelview (RenderOpBuilder *builder,
   entry->metadata.dx_before = builder->dx;
   entry->metadata.dy_before = builder->dy;
 
-  extract_matrix_metadata (transform, &entry->metadata);
+  extract_matrix_metadata (entry->transform, &entry->metadata);
 
   builder->dx = 0;
   builder->dy = 0;
diff --git a/testsuite/gsk/compare/scale-up-down.node b/testsuite/gsk/compare/scale-up-down.node
new file mode 100644 (file)
index 0000000..caa021e
--- /dev/null
@@ -0,0 +1,39 @@
+transform{
+  transform: scale(0.5);
+  child: transform {
+    transform: scale(8);
+    child: clip {
+      clip: 0 0 50 50 / 20 0 0 0;
+      child: color {
+        color: teal;
+      }
+    }
+  }
+}
+
+debug {
+  message: "clipped-out area";
+  child: container {
+    color { color: black;
+            bounds: 0 50 10 30; }
+    color { color: black;
+            bounds: 5 40 10 10; }
+    color { color: black;
+            bounds: 10 35 10 10; }
+    color { color: black;
+            bounds: 12 30 10 10; }
+    color { color: black;
+            bounds: 17 23 10 10; }
+    color { color: black;
+            bounds: 23 16 10 10; }
+    color { color: black;
+            bounds: 30 11 10 10; }
+    color { color: black;
+            bounds: 38 4 10 10; }
+    color { color: black;
+            bounds: 47 2 10 10; }
+    color { color: black;
+            bounds: 54 0 50 10; }
+  }
+
+}
\ No newline at end of file
diff --git a/testsuite/gsk/compare/scale-up-down.png b/testsuite/gsk/compare/scale-up-down.png
new file mode 100644 (file)
index 0000000..83ee845
Binary files /dev/null and b/testsuite/gsk/compare/scale-up-down.png differ
index a8aac553d85f2a366d04ac7dbe0d2e2a6853b5a3..5981f131d2cf4856620a9ede437b2b642de7e5d5 100644 (file)
@@ -56,6 +56,7 @@ compare_render_tests = [
   'texture-url',
   'color-matrix-identity',
   'clip-nested1',
+  'scale-up-down'
 ]
 
 renderers = [